home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PCMania 36
/
PCMania CD36_1.iso
/
pcmania
/
treal36
/
realdemo
/
nocontro.asm
< prev
next >
Wrap
Assembly Source File
|
1980-02-14
|
11KB
|
344 lines
.386p
jumps
code32 segment para public use32
assume cs:code32, ds:code32, ss:code32
; define externals
include pmode.inc ; protected mode externals
include xmouse.inc ; xmode mouse externals
include xmode.inc ; xmode externals by matt pritchard
include 3d.inc
include irq.inc
include stars.inc
include font.inc
include file.inc
include macros.inc
include equ.inc
include sphere.inc
include icon.inc
include gamecolr.inc ; dac palette
include stuff.inc ; ending screen stuff
; include argc.inc
public _main
include strltu.rt
include strhtn.rt
;-----------------------------------------------------------------------------
exiterr2:
mov edx,offset errmsg2
jmp short exiterr
;-----------------------------------------------------------------------------
exiterr1:
mov edx,offset errmsg1
jmp short exiterr
;-----------------------------------------------------------------------------
exiterr0:
mov edx,offset errmsg0
exiterr:
call _putdosmsg
jmp _exit
;═════════════════════════════════════════════════════════════════════════════
_main:
sti
call prepmod ;reservar espacio y leer y preparar modelos
push offset defpal
call fadeoffpalette
call setup_env ; set up file envirionment (eg c:\temp\thisprog.exe )
pushw xmode
pushw xactual
pushw yactual
pushw pages
call set_vga_modex
cmp ax,-1 ; test for error in setting videomode
jne getout
call wipeoffpalette
; call set_pmirq ; select irq:use one or the other
call set_rmirq
call setupbase
call initpages
push o gamecolr
call fadeonpalette
mov si,cameraobject ; set the camera position
mov bx,0 ; camera angle
mov cx,0
mov bp,0
call set_angle
mov ebx,-18000 ; camera position
mov ecx,0
mov ebp,0
call put_object
mov si,1 ; now place 1st object
mov ebx,0 ; to this position (x,y,z)=ebx,ecx,ebp
mov ecx,0 ; locations are 32 bit
mov ebp,6680000
call put_object ; plop..
mov bx,46080 ; angles are 16 bit
mov cx,0
mov bp,0
call set_angle ; duhhh...i wonder what this call does...
call set_object_on ; turn object si on (make visible)
mov ebx,0 ; to this position (x,y,z)=ebx,ecx,ebp
mov ecx,0 ; locations are 32 bit
mov ebp,-7680000
mov di,2000
call move_si
call set_finall
;
mov userotate[esi],0 ; full rotations for this object (0)
mov ax,0
call set_shape ; set object si to shape ax
mov userotate[esi],0
mov ebx,000245100h
mov ecx,000591500h
mov ebp,000742300h
mov di,8000 ; di = time to twist there (total frames)
call twist_si ; set angular velocity
call set_finala ; set final anglular position (pre-calculation)
;
mov si,2 ; now place 1st object
mov ebx,40000
mov ecx,-140000
mov ebp,8680000
call put_object ; plop..
mov bx,46080 ; angles are 16 bit
mov cx,0
mov bp,0
call set_angle ; duhhh...i wonder what this call does...
call set_object_on ; turn object si on (make visible)
mov ebx,0 ; to this position (x,y,z)=ebx,ecx,ebp
mov ecx,-140000
mov ebp,-7680000
mov di,2000
call move_si
call set_finall
mov ebx,o nullpalette ; set cross referencing palette (null)
call set_xref_palette
; mov si,1 ; follow first object
; mov di,5500 ; 55 frames to get there
; call newfollow
; mov eyezadds,50 ; make the camera rotate along it's z axis (just for fun)
; mov esi,cameraobject
; call set_finala
call reset_raster_count ; done before any animation loop!!!
call init_tables ; initialize 3d vector stuff
; mov si,5 ; an example of how to use point_time
; mov ebx,-10000 ; si = obj, bx,cx,bp = location, di = time
; mov ecx,-30000
; mov ebp,90000
; mov di,150
; call point_time
; the main loop...
ieox:
mov esi,0
add xs[esi*4],90
mov wherelook,1
call look_at_it ; make camera look at selected object
;ieox:
; mov si,1 ; try uncommenting this!, this will point
; mov di,cameraobject ; the bitmapped cube at the camera. also
; call point_it ; uncomment it below, at ieox3:
; mov eax,your_problem ; debugging tool!!!!
; mov number_eax,eax
; call put_at_top
; add y_angle_of_sun,150 ; watch the red ring carefully! the sun will move around the room!
; mov si,1
; mov di,600 ; di = total time (not in calculation)
; call set_speed ; move object in direction it is pointing
; call set_finall ; then calculate final position (not important as long as it keeps moving)
; call look_at_it ; make camera look at selected object
call setsincose ; set rotation multipliers for eye
call show_stars ; plot background stars
call makeobjs ; plot all objects in sides table
; call instant_mouse ; plot mouse on screen
call flip_page ; flip video pages
call clear_fill ; clear video memory (last screen)
call resetupd ; reset borders
;mov ax,traces_past ; show number of traces past per re-draw
;mov number_eax,eax
;call put_at_top
call updvectors ; move objects around, rotate them
in al,60h ; test keyboard
cmp al,1
je getout
mov esi,1
cmp zs[esi*4],-7680000
je getout
; call reset_raster_count ; done because esc key pressed!!!
jmp ieox
getout:
call reset_rmirq ; use one or the other, could use both if
; call reset_pmirq ; needed but delete inc traces_past from pmode
jmp endpage ; jump to stuff.inc for ending
; ========================================================================
;
;************ Siguen rutinas Rambianas *******************
setupbase:
mov ESI,outptr
mov objbase[0*4],ESI
; mov objbase[1*4],offset headercube2
; mov objbase[2*4],offset headerring
; mov objbase[3*4],offset headerdiamond
; mov objbase[4*4],offset headerrubine
; mov objbase[5*4],offset headercube3
; mov objbase[5*4],ESI
; mov objbase[6*4],offset headercube4
;
; mov objbase[0*4],offset pella
mov esi,0 ; from object #
mov edi,1 ; to object #
call set_up_all_lambert ; find and set up shading tables
ret
;sigue lista de modificaciones rambianas
prepmod:
; xor al,al ; chek for filename on commandline
; mov edx,offset inputname
; call _cchekstr
; jc exiterr0
xor al,al
mov edx,offset inputname
call _openfile ; attempt to open file
jc exiterr1
mov eax,4000h ; setup file buffer
call _getlomem
mov _filebufloc,eax
call _filesize
mov filelen,eax
call _gethimem ; chek for, and get enough himem
jc exiterr2
mov outptr,eax ;puntero al fichero leido
mov edx,outptr ; load file into himem
mov ecx,filelen ; restore actual filesize for load
call _readfile
call _closefile ; file is in memory! kowabunga!
ret
temp dw 1 ; next object to look at, for this demo only
eyeloc dw 0 ; indexer for camera (this demo only)
eyexq dd 195000,180000,-240000,-280000
eyeyq dd -30000,25000,-35000,30000
eyezq dd -270000,310000,240000,-220000
eyetime dw 220,254,220,180
public objbase ; make sure these are here even if you don't
public bitbase ; use them. tlink will fail if not present.!
public bitx
public bity
numberofobjects equ 32 ; number of 3d objects to allocate space for
numberofbitmaps equ 32 ; number of 3d bitmaps to allocate space for
align 4
objbase dd numberofobjects*4 dup (0) ; memory locations of shapes (offsets)
bitbase dd numberofbitmaps dup (0) ; memory locations of bitmaps
bitx dd numberofbitmaps dup (0) ; x base size of bitmaps (for 3d)
bity dd numberofbitmaps dup (0) ; y base size of bitmaps
;siguen datos rambianos
errmsg0 db 'SYNTAX: TGA2ICON [-a#] filename',0dh,0ah,0dh,0ah
db ' -a add number to all numbers in sorted TGA output',0dh,0ah
errmsg1 db 'Error opening input file!$'
errmsg2 db 'Not enough extended memory to load file!!!$'
rambopos dd 768000
;inputname db 60 dup (?)
inputname db 'sonico3.mot'
db 0
filelen dd ?
outputname db 60 dup (?)
labellen dd ?
outptr dd ?
addvalue db 5 dup (0)
pallet dd 999 dup (?)
psize dw 0
xsize dw 0
xcount dw 0
ysize dw 0
temp1 dw 0
temp2 dw 0
inverted db 0
chars db "0123456789abcdef"
byte2 db "0",0
vc dd 0
xq dw 0
wide dw 0 ; width checker (in case line>255 characters)
code32 ends
end